﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage1.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    .style2
    {
        text-align: center;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style=" width:70%; margin:20px auto;">
    <div style=" height:50px; width:100%">
        <table class="style1">
            <tr>
                <td style="text-align: right">
                    <asp:TextBox ID="TextBox2" runat="server" value="输入产品名或牌号" onfocus ="if (value == '输入产品名或牌号'){value=''}" onblur ="if (value ==''){value='输入产品名或牌号'}"></asp:TextBox>
                </td>
                <td width="10%">
                    <asp:Button ID="Button2" runat="server" Text="查询" onclick="Button2_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div>
    <asp:DataList ID="DataList1" runat="server" 
        RepeatColumns="3" RepeatDirection="Horizontal" 
        onitemcommand="DataList1_ItemCommand1" 
        onitemdatabound="DataList1_ItemDataBound">
        <FooterTemplate>
                <div class="style2">
                    共有<asp:Label ID="Label4" runat="server" BorderStyle="None" Text="Label"></asp:Label>
                    页 当前<asp:Label ID="Label6" runat="server" Text="Label"></asp:Label>
                    页 
                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="first">首页</asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CommandName="pre">上一页</asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton3" runat="server" CommandName="next">下一页</asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton4" runat="server" CommandName="last">尾页</asp:LinkButton>
                    &nbsp;跳转至:<asp:TextBox ID="TextBox1" runat="server" Width="30px"></asp:TextBox>
                    <asp:Button ID="Button1" runat="server" CommandName="search" Text="确定" />
                </div>
            </FooterTemplate>
        <ItemTemplate>
           <table class="style1" style="height: 294px; width: 84%;">
                <tr>
                    <td class="style2">
                        <asp:Label ID="product_nameLabel" runat="server" 
                            Text='<%# Eval("product_name") %>' />
                    </td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td rowspan="4" class="style2">
                        <asp:Image ID="Image1" runat="server" Height="258px" 
                            ImageUrl='<%# Eval("image") %>' Width="175px" />
                    </td>
                    <td>
                        <strong>牌号：</strong></td>
                    <td>
                        <asp:Label ID="shop_signLabel" runat="server" Text='<%# Eval("shop_sign") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        <strong>类型</strong>：</td>
                    <td>
                        <asp:Label ID="typeLabel" runat="server" Text='<%# Eval("type") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        <strong>单价</strong>：</td>
                    <td>
                        <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center">
                        <asp:HyperLink ID="HyperLink8" runat="server" 
                            NavigateUrl='<%# "~/product1.aspx?id="+Eval("shop_sign") %>'>购买</asp:HyperLink>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:DataList>
    </div>
    </div>
</asp:Content>

